package work.mediway.mdm.biz.service.biz;

import java.sql.SQLException;
import java.util.List;

import work.mediway.mdm.core.entity.IndexInfo;
import work.mediway.mdm.core.entity.Table;
import work.mediway.mdm.core.transport.ErrorMsgVO;

/**
 * @author zhongyj <1126834403@qq.com><br/>
 * @date 2022/6/30
 */
public interface TableModelService {
    /**
     * 创建数据库表
     *
     * @param table Table
     */
    void createTable(Table table);

    /**
     * 删除数据库表
     *
     * @param tableName List<String>
     * @return ErrorMsgVO
     */
    ErrorMsgVO deleteTable(List<String> tableName);

    /**
     * 获取表模型详情
     *
     * @param tableName String
     * @return Table
     */
    Table selectTable(String tableName);

    /**
     * 更新数据库表
     *
     * @param table Table
     * @throws SQLException SQLException
     */
    void updateTable(Table table) throws SQLException;

    /**
     * 获取表索引
     *
     * @param tableName String
     * @return List<IndexInfo>
     */
    List<IndexInfo> selectTableIndexInfo(String tableName);

    /**
     * 新增表索引
     *
     * @param indexInfos List<IndexInfo>
     * @return ErrorMsgVO
     */
    ErrorMsgVO saveTableIndexInfo(List<IndexInfo> indexInfos);

    /**
     * 删除表索引
     *
     * @param indexName IndexInfo.IndexInfoDTO
     * @return ErrorMsgVO
     */
    ErrorMsgVO deleteTableIndexInfo(IndexInfo.IndexInfoDTO indexName);
}

